import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: "/",
            redirect: "/dashboard",
            component:  () => import('@/layout/index.vue'),
            children: [
                {
                    path: "dashboard",
                    name: "dashboard",
                    // 懒加载
                    component: () => import('@/views/dashboard/index.vue')
                }
            ],
        },
        {
            name: "首页",
            path: "/index",
            // 懒加载
            component: () => import('@/views/index.vue')
        },
        {
            name: "登录",
            path: "/login",
            // 懒加载
            component: () => import('../views/login/login.vue')
        }
    ]
  })
  
  export default router